/* $RCSFile: ADNDynCommitment.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynCommitment.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:32  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynCommitment */
/* Date 2010-01-06 16:03:59Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
    public class ADNDynCommitment : DynEntity
    {
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.commitment)
            {}

            public override Type DynType
            { get { return typeof(ADNDynCommitment); } }

            public override string DynTypename
            { get { return CrmStr.commitment; } }

            public override DynEntity Build()
            {   return new ADNDynCommitment();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynCommitment(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynCommitment(w,PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynCommitment(w,PrimaryKeyValue);}
        }

        static ADNDynCommitment(){new Ftor();} 

        public override bool HasOwnerProperty
        {
            get { return false; }
        }
        
        public override bool HasPrimaryField
        {
            get
            { return false; }
        }

        public ADNDynCommitment() : base() { }
        
        public ADNDynCommitment(CRMWrapperBase w,string PrimaryFieldValue)
            : base(w,CrmStr.commitment)
        { }
        
        public ADNDynCommitment(CRMWrapperBase w,Guid CrmId) : base(w,CrmStr.commitment,CrmId) { }
        
        public ADNDynCommitment(CRMWrapperBase w,InternalDynamicEntity e) : base(w,CrmStr.commitment,e,null,null) { }
        
        public ADNDynCommitment(CRMWrapperBase w,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(w,CrmStr.commitment,e,prop,s) { }
        
        public ADNDynCommitment(ResetWrapperHandler fn,string PrimaryFieldValue)
            : base(fn,CrmStr.commitment)
        { }
        
        public ADNDynCommitment(ResetWrapperHandler fn,Guid CrmId) : base(fn,CrmStr.commitment,CrmId) { }
        
        public ADNDynCommitment(ResetWrapperHandler fn,InternalDynamicEntity e) : base(fn,CrmStr.commitment,e,null,null) { }
        
        public ADNDynCommitment(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(fn,CrmStr.commitment,e,prop,s) { }

        /* Properties */

        [CrmDynAttribute(CrmStr.commitment)]
        public Guid commitmentid
        {
            get
            { return KeyPropertyValue(CrmStr.commitmentid); }
            set
            { AddKeyProperty(CrmStr.commitmentid,value); }
        }

        protected override void SetCrmIdProperty(Guid crmId)
        {
            if ( !dicProperty.ContainsKey(CrmStr.commitmentid) || KeyPropertyValue(CrmStr.commitmentid) != crmId )
                commitmentid = crmId;
        }
        public override Guid PrimaryKeyGuidValue
        {
            get
            { return commitmentid; }
            set { commitmentid = value; }
        }
        [CrmDynAttribute(CrmStr.commitment)]
        public Guid activityid
        {
            get
            { return UniqueIdentifierPropertyValue(CrmStr.activityid); }
            set
            { AddUniqueIdentifierProperty(CrmStr.activityid,value); }
        }

        public string activityName
        {
            get
            { return LookupPropertyName(CrmStr.activityid); }
        }

        public string activityType
        {
            get
            { return LookupPropertyType(CrmStr.activityid); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public double effort
        {
            get
            { return DoublePropertyValue(CrmStr.effort); }
            set
            { AddFloatProperty(CrmStr.effort,value); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public int participationtypemask
        {
            get
            { return NumberPropertyValue(CrmStr.participationtypemask); }
            set
            { AddNumberProperty(CrmStr.participationtypemask,value); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public Guid partyid
        {
            get
            { return UniqueIdentifierPropertyValue(CrmStr.partyid); }
            set
            { AddUniqueIdentifierProperty(CrmStr.partyid,value); }
        }

        public string partyName
        {
            get
            { return LookupPropertyName(CrmStr.partyid); }
        }

        public string partyType
        {
            get
            { return LookupPropertyType(CrmStr.partyid); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public Guid resourcespecid
        {
            get
            { return UniqueIdentifierPropertyValue(CrmStr.resourcespecid); }
            set
            { AddUniqueIdentifierProperty(CrmStr.resourcespecid,value); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public string scheduledend
        {
            get
            { return DateTimePropertyValue(CrmStr.scheduledend); }
            set
            { AddDateTimeProperty(CrmStr.scheduledend,value); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public string scheduledstart
        {
            get
            { return DateTimePropertyValue(CrmStr.scheduledstart); }
            set
            { AddDateTimeProperty(CrmStr.scheduledstart,value); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public Guid serviceid
        {
            get
            { return LookupPropertyValue(CrmStr.serviceid); }
            set
            { AddLookupProperty(CrmStr.serviceid,CrmStr.service,value); }
        }

        public string serviceName
        {
            get
            { return LookupPropertyName(CrmStr.serviceid); }
        }

        public string serviceType
        {
            get
            { return LookupPropertyType(CrmStr.serviceid); }
        }

        [CrmDynAttribute(CrmStr.commitment)]
        public string subject
        {
            get
            { return StringPropertyValue(CrmStr.subject); }
            set
            { AddStringProperty(CrmStr.subject,value); }
        }
    }
}